L=1000000000; S=3; T=4; M=100; stones=[194253472,194253476,194253479,311701501,556872207,14927650,968889621,194253477,194253480,194253475,91134194,218484377,281965281,40187586,739934785,262376631,874914691,26932501,36410480,31809451,150826127,150826130,150826122,150826129,353234007,150826125,297734698,698222561,150702229,12024661,9018376,111853422,787993195,303205992,150826123,240875251,150826128,93505537,392766193,276111100,925758768,925758771,925758770,925758765,581984833,27682257,925758773,289946455,925758769,33150001,72944236,925758767,849958123,69048401,278416585,50140238,318979576,202517511,510099001,925758766,415617408,415617405,415617407,415617401,59549281,415617406,234408889,415617403,415617402,500339654,21185699,10062911,415617409,143479009,184168741,415617404,328136945,158638748,277668121,16890898,846893282,846893285,341678833,846893284,846893281,385765966,1483126,846893287,846893283,215645947,471651,112881781,171070081,485932771,846893286,295207254,846893288,91758151,559990145,210141661];